#pragma once
#include "Ogre.h"
#include "..\shared\shared_types.h"

namespace Putin{


	
/* Communicates with Ogre, could be exanged for another object 
 * with the same functionality.
 */

class WorldLink
{
public:
	WorldLink(Ogre::SceneManager* sceneMgr);
	
	virtual ~WorldLink();

	/* 
	 * Returns the height of the ground at a specific x/z pos
	 */
	virtual float getHeight(Vec3f pos);

	/* 
	 * Returns the normal to the plane with a default location and ammount of sample points
	 */
	virtual Vec3f getNormal(Vec3f pos);
	
	/*
	 * Getters for AABB and OBB
	 */

	virtual Vec3f getUnitAABBhalfSize(int nr);
	virtual Vec3f getUnitOBBhalfSize(int nr);

private:
	Ogre::RaySceneQuery *mRaySceneQuery;	// The ray scene query pointer
	Ogre::Ray queryRay;					// The ray used for the query
	Ogre::SceneManager *mSceneManager;	// Used to destroy the ray in destructor

};

}//End namespace Putin